package com.jz.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;


/**
 * @author doumuxie
 * @version 1.0
 * @date 2019/11/19 20:22
 * @description 项目启动加载
 * //如果多个自定义ApplicationRunner，用来标明执行顺序
 **/
@Component
@Order(1)
public class ApplicationRunnerConfig implements ApplicationRunner {

    private static final Logger logger = LoggerFactory.getLogger(ApplicationRunnerConfig.class);

    @Override
    public void run(ApplicationArguments args) throws Exception {

    }

//    @Autowired
//    private CacheService cacheService;
//
//    @Override
//    @SuppressWarnings("all")
//    public void run(ApplicationArguments applicationArguments) throws Exception {
//        try {
//            if (cacheService.loadCache()) {
//                logger.info("==============缓存加载完成===========");
//            } else {
//                logger.error("==============缓存加载失败===========");
//            }
//        } catch (Exception e) {
//            logger.error("===============缓存加载异常==============");
//        }
//    }

}
